<%@ page import="com.future.Task" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <g:set var="entityName" value="${message(code: 'task.label', default: 'Task')}"/>
  <title><g:message code="default.edit.label" args="[entityName]"/></title>
</head>
<body>
<div class="nav">
  <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
  <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]"/></g:link></span>
  <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]"/></g:link></span>
</div>
<div class="body">
  <h1><g:message code="default.edit.label" args="[entityName]"/></h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${taskInstance}">
    <div class="errors">
      <g:renderErrors bean="${taskInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form method="post" enctype="multipart/form-data">
    <g:hiddenField name="id" value="${taskInstance?.id}"/>
    <g:hiddenField name="version" value="${taskInstance?.version}"/>
    <div class="dialog">
      <table>
        <tbody>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskSerialNumber"><g:message code="task.taskSerialNumber.label" default="Task Serial Number"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskSerialNumber', 'errors')}">
            <g:textField name="taskSerialNumber" value="${taskInstance?.taskSerialNumber}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskName"><g:message code="task.taskName.label" default="Task Name"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskName', 'errors')}">
            <g:textField name="taskName" value="${taskInstance?.taskName}"/>
          </td>
        </tr>



        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskPlanCycle"><g:message code="task.taskPlanCycle.label" default="Task Plan Cycle"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskPlanCycle', 'errors')}">
            <g:textField name="taskPlanCycle" value="${fieldValue(bean: taskInstance, field: 'taskPlanCycle')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskFactCycle"><g:message code="task.taskFactCycle.label" default="Task Fact Cycle"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskFactCycle', 'errors')}">
            <g:textField name="taskFactCycle" value="${fieldValue(bean: taskInstance, field: 'taskFactCycle')}"/>
          </td>
        </tr>

        %{--<tr class="prop">--}%
          %{--<td valign="top" class="name">--}%
            %{--<label for="taskPlanBeginDate"><g:message code="task.taskPlanBeginDate.label" default="Task Plan Begin Date"/></label>--}%
          %{--</td>--}%
          %{--<td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskPlanBeginDate', 'errors')}">--}%
            %{--<g:datePicker name="taskPlanBeginDate" precision="day" value="${taskInstance?.taskPlanBeginDate}"/>--}%
          %{--</td>--}%
        %{--</tr>--}%

        %{--<tr class="prop">--}%
          %{--<td valign="top" class="name">--}%
            %{--<label for="taskPlanCompleteDate"><g:message code="task.taskPlanCompleteDate.label" default="Task Plan Complete Date"/></label>--}%
          %{--</td>--}%
          %{--<td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskPlanCompleteDate', 'errors')}">--}%
            %{--<g:datePicker name="taskPlanCompleteDate" precision="day" value="${taskInstance?.taskPlanCompleteDate}" noSelection="['': '']"/>--}%
          %{--</td>--}%
        %{--</tr>--}%

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskCompleteRate"><g:message code="task.taskCompleteRate.label" default="Task Complete Rate"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskCompleteRate', 'errors')}">
            <g:textField name="taskCompleteRate" value="${fieldValue(bean: taskInstance, field: 'taskCompleteRate')}"/>
          </td>
        </tr>



        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskRelationship"><g:message code="task.taskRelationship.label" default="Task Relationship"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskRelationship', 'errors')}">
            <g:select name="taskRelationship.id" from="${com.future.Task.list()}" optionKey="id" value="${taskInstance?.taskRelationship?.id}" noSelection="['null': '']"/>
          </td>
        </tr>

        <tr class="prop">
            <td valign="top" class="name">
                <label for="taskPicture"><g:message code="task.taskPicture.label" default="Task Picture" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskPicture', 'errors')}">
                <input type="file" id="taskPicture" name="taskPicture" />
            </td>
        </tr>

        <tr class="prop">
            <td valign="top" class="name">
                <label for="taskUML"><g:message code="task.taskUML.label" default="Task UML" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskUML', 'errors')}">
                <input type="file" id="taskUML" name="taskUML" />
            </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskInfo"><g:message code="task.taskInfo.label" default="Task Info"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskInfo', 'errors')}">
            <fckeditor:editor  toolbar="Standard" id='taskInfo' name='taskInfo' width="100%" height="350">${taskInstance?.taskInfo}</fckeditor:editor>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskThink"><g:message code="task.taskThink.label" default="Task Think"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskThink', 'errors')}">
            <fckeditor:editor  toolbar="Standard" id='taskThink' name='taskThink' width="100%" height="350">${taskInstance?.taskThink}</fckeditor:editor>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskUpgrade"><g:message code="task.taskUpgrade.label" default="Task Upgrade"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskUpgrade', 'errors')}">
            <fckeditor:editor  toolbar="Standard" id='taskUpgrade' name='taskUpgrade' width="100%" height="350">${taskInstance?.taskUpgrade}</fckeditor:editor>
          </td>
        </tr>

        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}"/></span>
      <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
